/*
 * @Author: 陈俊升 761723995@qq.com
 * @Date: 2023-11-08 08:51:15
 * @LastEditors: 陈俊升 761723995@qq.com
 * @LastEditTime: 2023-11-30 17:12:35
 * @FilePath: /hr_new_vue3/src/apis/management/contract/baseSetting/index.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
/* 合同-已签署合同列表api */

import { ajaxService } from '@/utils/request';

const env = import.meta.env;
// const baseURL1 = env.VITE_API_BASE_URL;
const baseURL = env.VITE_DEV_BASE_URL;
// const baseURL = env.VITE_APP_BASE_URL;
const baseURL2 = env.VITE_APP_BASE_URL;
const baseURL3 = env.VITE_DEV_BASE_URL;

/**
 * 修改已签署合同状态
 * id 人员id
 * type 11合同终止 12合同解除
 */
export function ChangeContractState(data: { id: number; type: number }) {
  return ajaxService({
    url: '/hr/contract/basic_setting/contract_list/contract',
    method: 'put',
    data,
    baseURL
  });
}

/**
 * 获取已签署合同详情
 */
export function GetContractDetail(params: { id: number }) {
  return ajaxService({
    url: '/hr/contract/basic_setting/contract_list/detail',
    method: 'get',
    params,
    baseURL
  });
}

/**
 * 合同变更
 */
export function ChangeContract(data: any) {
  return ajaxService({
    url: '/hr/contract/basic_setting/contract_list/contract',
    method: 'post',
    data,
    baseURL
  });
}

/**
 * 获取已签署合同文件详情
 * id 人员id
 */
export function GetContractDetailFiles(params: { id: number }) {
  return ajaxService({
    url: '/hr/contract/basic_setting/contract_list/xzai',
    method: 'get',
    params,
    baseURL
  });
}

/**
 * 我的合同
 * id 人员id
 */
export function GetMyContractPage(params: { id: number }) {
  return ajaxService({
    url: '/hr/contract/basic_setting/contract_list/my',
    method: 'get',
    params,
    baseURL
  });
}
